package com.easygoods.enums;

/**
 * Created by 许崇雷 on 2018-12-28.
 * 用户状态
 */
public enum UserState {
    Normal,//正常
    Deleted,//逻辑删除
    Locked;//锁定

    public LoginResult toLoginResult() {
        switch (this) {
            case Normal:
                return LoginResult.Success;
            case Deleted:
                return LoginResult.Deleted;
            case Locked:
                return LoginResult.Locked;
            default:
                throw new RuntimeException("未知用户状态");
        }
    }
}
